﻿// ****************************************************************************
// <copyright file="InteractivityMetadataStore.cs" company="Davide Zordan">
// Copyright © Davide Zordan 2010
// </copyright>
// ****************************************************************************
// <author>Davide Zordan</author>
// <email>info@davidezordan.net</email>
// <date>07.07.2010</date>
// <project>MultiTouch.Behaviors.Silverlight4.Design</project>
// <web>http://multitouch.codeplex.com/</web>
// <license>
// See http://multitouch.codeplex.com/license.
// </license>
// ****************************************************************************

using System.ComponentModel;
using System.Reflection;
using Microsoft.Windows.Design;
using Microsoft.Windows.Design.Metadata;
using MultiTouch.Behaviors.Silverlight4.Design;

[assembly: ProvideMetadata(typeof(InteractivityMetadataStore))]

namespace MultiTouch.Behaviors.Silverlight4.Design
{
    /// <summary>
    /// Design-time experience for the MultiTouch Behavior
    /// </summary>
    public class InteractivityMetadataStore : IProvideAttributeTable
    {
        public AttributeTable AttributeTable
        {
            get
            {
                var type = typeof(MultiTouchBehavior);
                var builder = new AttributeTableBuilder();
                builder.AddCustomAttributes(type, new ToolboxCategoryAttribute("Touch"));

                foreach (var property in type.GetProperties(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public))
                {
                    builder.AddCustomAttributes(type, property.Name, new CategoryAttribute("Common Properties"));
                }

                return builder.CreateTable();
            }
        }
    }
}
